cmake_minimum_required(VERSION 3.19)
project(QTalkServer LANGUAGES CXX)

find_package(Qt6 6.5 REQUIRED COMPONENTS Core Network Sql)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)


qt_standard_project_setup()

qt_add_executable(QTalkServer
    main.cpp
    mytcpserver.h mytcpserver.cpp
    mytcpsocket.h mytcpsocket.cpp
    databasemanager.h databasemanager.cpp



)

target_link_libraries(QTalkServer
    PRIVATE
        Qt::Core
        Qt::Network
        Qt::Sql
)
target_link_libraries(QTalkServer PRIVATE Qt6::Core)
target_link_libraries(QTalkServer PRIVATE Qt6::Core)
target_link_libraries(QTalkServer PRIVATE Qt6::Core)
target_link_libraries(QTalkServer PRIVATE Qt6::Core)
target_link_libraries(QTalkServer PRIVATE Qt6::Core)

include(GNUInstallDirs)

install(TARGETS QTalkServer
    BUNDLE  DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
